package com.jrew.gae.util;

import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

/**
 *  Creation of entity manager factory is cost-performance operation.
 *  EntityManagerFactoryStorage implements single tone design pattern and stores ones created entity manager factory object
 */
public class EntityManagerFactoryStorage {
	
	private static final String PERSISTENCE_UNIT_NAME = "records-persistence-unit";
	private static final EntityManagerFactory emfInstance = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);

    /**
     * 
     */
    private EntityManagerFactoryStorage() {}

    /**
     * @return
     */
    public static EntityManagerFactory getInstance() {
        return emfInstance;
    }
}
